package com.pj;

import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.swing.*;
import java.net.InetAddress;

@SpringBootApplication
public class RAGFlowApplication implements CommandLineRunner {

    @Value("${server.port}")
    private  String port;

    @Value("${server.servlet.context-path}")
    private  String contextPath;


    public static void main(String[] args) throws Exception {
        SpringApplication.run(RAGFlowApplication.class, args);
//        System.out.println("启动成功：Sa-Token配置如下：" + SaManager.getConfig());
    }

    @Override
    public void run(String... args) throws Exception {
        String ip = InetAddress.getLocalHost().getHostAddress();
        String url = "http://" + ip + ":" + port + (contextPath.equals("/") ? "" : contextPath);
        System.out.println("\n===========================================");
        System.out.println("🚀 项目启动成功！访问地址: " + url);
        System.out.println("===========================================\n");
    }
}
